/*
 * Copyright (c) United Binary LLC.  All rights reserved.
 * 
 * This code is licensed under the MIT License
 * 
 * SEE: http://harnessit.codeplex.com/license
 * 
 */
using System;
using System.Diagnostics;
using System.IO;

namespace UnitedBinary.Core.Windows.Forms.Persistence
{
	/// <include file='Persistence.xml' path='/Docs/RecentFile/Class/*'/>
	public class RecentFile
	{
		private string file = string.Empty;

		/// <include file='Persistence.xml' path='/Docs/RecentFile/ctor/*'/>
		public RecentFile()
		{
		}

		/// <include file='Persistence.xml' path='/Docs/RecentFile/ctor_string/*'/>
		public RecentFile(string fileName)
		{
			file = fileName;
		}

		/// <include file='Persistence.xml' path='/Docs/RecentFile/FileName/*'/>
		public string FileName
		{
			get
			{
				return file;
			}
			set
			{
				file = value;
			}
		}

		/// <include file='Persistence.xml' path='/Docs/RecentFile/Exists/*'/>
		public bool Exists
		{
			get
			{
				FileInfo fi = new FileInfo(file);
				Debug.WriteLine("Exists=" + fi.Exists + ", File=" + file);
				return fi.Exists;
			}
		}
	}
}
